package com.sevennotes.classtable.ui.pages.components

import android.app.DatePickerDialog
import android.content.Context
import androidx.compose.ui.platform.LocalContext
import java.util.*

fun myDatePicker(from: Date, context: Context, onPicked: (Date) -> Unit): DatePickerDialog {
    val c = Calendar.getInstance()
    c.time = from
    val datePicker = DatePickerDialog(context, { _, year, month, day ->
        c.set(year, month, day)
        onPicked(c.time)
    },c.get(Calendar.YEAR), c.get(Calendar.MONTH), c.get(Calendar.DAY_OF_MONTH))
    return datePicker
}